﻿<%@ Control
    Language="C#"
    AutoEventWireup="true"
    CodeBehind="UserList.ascx.cs"
    Inherits="AutoStopApp.Controls.UserList" %>
<%@ Register
    TagPrefix="sc"
    Assembly="AutoStopApp"
    Namespace="AutoStopApp.ServerControls" %>
<div>
    <sc:CustomGrid
        ID="rgrUsers"
        runat="server"
        AutoGenerateColumns="False"
        CellSpacing="0"
        DataSourceID="odsUsers"
        GridLines="None">
        <MasterTableView
            DataSourceID="odsUsers"
            AllowAutomaticUpdates="True"
            AllowAutomaticDeletes="True"
            DataKeyNames="UserId">
            <CommandItemTemplate>
                <div
                    style="padding: 3px 3px;">
                    <div
                        class="GridCommandItem">
                        <asp:LinkButton
                            ID="LinkButton4"
                            runat="server"
                            CommandName="RebindGrid">
                        <img style="border:0px" alt="" src="/images/icons16/arrow_refresh.png" />
                        Znovu načítať
                        </asp:LinkButton>
                    </div>
                    <div
                        class="GridCommandItem">
                        <telerik:RadButton
                            ID="DisplayAlsoBannedUsersButton"
                            runat="server"
                            ToggleType="CheckBox"
                            ButtonType="ToggleButton"
                            AutoPostBack="true"
                            Text="Zobraziť aj zabanovaných užívateľov"
                            OnClick="DisplayAlsoBannedUsersButtonClick"/>
                    </div>
                </div>
            </CommandItemTemplate>
            <Columns>
                <telerik:GridEditCommandColumn
                    ButtonType="ImageButton"
                    UniqueName="EditCommandColumn"
                    HeaderStyle-Width="20px" />
                <telerik:GridBoundColumn
                    DataField="Mail"
                    HeaderText="E-Mail"
                    ReadOnly="true" />
                <telerik:GridBoundColumn
                    DataField="Name"
                    HeaderText="Meno" />
                <telerik:GridBoundColumn
                    DataField="Contact"
                    HeaderText="Kontakt" />
                <telerik:GridDropDownColumn
                    DataSourceID="odsUserTypes"
                    ListTextField="LocalizedName"
                    ListValueField="UserTypeCode"
                    HeaderText="Typ"
                    DataField="UserTypeCode"
                    ReadOnly="true"
                    HeaderStyle-Width="70px" />
                <telerik:GridDateTimeColumn
                    DataField="Created"
                    HeaderText="Vytvorené"
                    ReadOnly="true"
                    HeaderStyle-Width="120px" />
                <telerik:GridCheckBoxColumn
                    DataField="Banned"
                    HeaderText="Má ban"
                    HeaderStyle-Width="60px" />
                <telerik:GridButtonColumn
                    ConfirmText="Naozaj chcete odstrániť tento záznam?"
                    ConfirmTitle="Výstraha"
                    ButtonType="ImageButton"
                    ConfirmDialogType="RadWindow"
                    CommandName="Delete"
                    UniqueName="DeleteCommandColumn"
                    HeaderStyle-Width="20px" />
            </Columns>
            <RowIndicatorColumn
                FilterControlAltText="Filter RowIndicator column">
                <HeaderStyle
                    Width="20px" />
            </RowIndicatorColumn>
            <ExpandCollapseColumn
                FilterControlAltText="Filter ExpandColumn column">
                <HeaderStyle
                    Width="20px" />
            </ExpandCollapseColumn>
            <EditFormSettings>
                <EditColumn
                    FilterControlAltText="Filter EditCommandColumn column" />
            </EditFormSettings>
        </MasterTableView>
        <FilterMenu
            EnableImageSprites="False" />
        <HeaderContextMenu
            CssClass="GridContextMenu GridContextMenu_Default" />
    </sc:CustomGrid>
    <asp:ObjectDataSource
        ID="odsUsers"
        runat="server"
        TypeName="AutoStopData.BussinessLogic.Users"
        DataObjectTypeName="AutoStopData.Model.User"
        UpdateMethod="Update"
        DeleteMethod="Delete" />
    <asp:ObjectDataSource
        ID="odsUserTypes"
        runat="server"
        TypeName="AutoStopData.Domains.UserTypes"
        SelectMethod="All" />
</div>
